package com.vhall.component.controller.notice.facade;

import com.alibaba.fastjson.JSONObject;
import com.vhall.component.entity.notice.vo.RedPacketNoticeVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author guoxin.wang
 * @date 2021/06/15 13:45
 */
@FeignClient(value = "NoticeInnerFacade", path = "/v4/inner/notice")
public interface NoticeInnerFacade {

    /**
     * 程序间调用 发布公告
     *
     * @param vo
     * @return
     */
    @PostMapping("/rp-add")
    RedPacketNoticeVo addRpNotice(@Validated RedPacketNoticeVo vo);

    /**
     * 程序间调用 发布公告
     *
     * @param rpUuid 红包id
     * @return
     */
    @GetMapping("/rp-get")
    RedPacketNoticeVo getRpNotice(@RequestParam("red_packet_uuid") String rpUuid);

    /**
     * 程序间调用 发布公告
     *
     * @param vo 红包id
     * @return
     */
    @PostMapping("/rp-edit")
    RedPacketNoticeVo updateRpNotice(@Validated RedPacketNoticeVo vo);

    /**
     * 发送公告公共接口
     *
     * @param roomId    房间id
     * @param content   文本
     * @param accountId 用户id
     * @param type      类型
     * @return 返回值
     */
    @GetMapping("/send-notice-paas")
    JSONObject sendNoticeToPaas(@RequestParam("roomId") String roomId, @RequestParam("content") String content,
                                @RequestParam("accountId") Integer accountId, @RequestParam("type") String type);


}